/*
 *
 * Copyright (c) 2001-2002 RagingCat Project.
 * LGPL License.
 * http://code.google.com/p/keytool-iui/
 *
 * This software is the confidential and proprietary information of RagingCat Project.
 * You shall not disclose such confidential information and shall use it only in
 * accordance with the terms of RagingCat Project's license agreement.
 *
 * THE SOFTWARE IS PROVIDED AND LICENSED "AS IS" WITHOUT WARRANTY OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
 *
 * LICENSE FOR THE SOFTWARE DOES NOT INCLUDE ANY CONSIDERATION FOR ASSUMPTION OF RISK
 * BY KEYTOOL IUI PROJECT, AND KEYTOOL IUI PROJECT DISCLAIMS ANY AND ALL LIABILITY FOR INCIDENTAL
 * OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF OR INABILITY
 * TO USE THE SOFTWARE, EVEN IF KEYTOOL IUI PROJECT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
 *
 */
 
 
package com.google.code.p.keytooliui.shared.swing.frame;

/**
    "Sw" means "Secondary Window"
    "Rtp" means "RTP-RRTSP"
    
    known subclasses:
    . FSwRtpAudio
    . FSwRtpVideoAbs
**/

import com.google.code.p.keytooliui.shared.lang.*;
import com.google.code.p.keytooliui.shared.swing.panel.*;




import java.awt.*;
import java.awt.event.*;

abstract public class FSwRtpAbs extends FSwAbs implements 
    ActionListener
{
    // ------
    // PUBLIC
    
    public void startSession()
    {
        if (super._pnlContentPane_ != null)
            ((PCpSwRtpAbs) super._pnlContentPane_).start();
    }
    
    public void actionPerformed(ActionEvent evtAction)
    {         
        String strMethod = "actionPerformed(evtAction)";
        
        // handle in frameContainer
        if (evtAction.getSource() instanceof com.google.code.p.keytooliui.shared.swing.button.BESPageReload16)
        {
            ((com.google.code.p.keytooliui.shared.swing.button.BESPageReload16) evtAction.getSource()).setEnabled(false);
            
            ((PCpSwRtpAbs) super._pnlContentPane_).stop();
            ((PCpSwRtpAbs) super._pnlContentPane_).start();
            
            // ending
            return;
        }
        
        // handle in frameContainer
        if (evtAction.getSource() instanceof com.google.code.p.keytooliui.shared.swing.button.BESPageAbout16)
        {
            if (super._pnlContentPane_ != null)
            {
                ((PCpSwRtpAbs) super._pnlContentPane_).showAboutPage();
            }
            
            // ending
            return;
        }
        
        MySystem.s_printOutExit(this, strMethod, 
            "instance of evtAction.getSource() not caught, evtAction.getSource().getClass().toString()=" + 
            evtAction.getSource().getClass().toString());
    }
    
    
    
    
    
    
    
    
    
    
    // ---------
    // PROTECTED
    
    
    
        
    protected FSwRtpAbs(
        Window winMainAppli,
        String strTitleApplication, 
        Image imgIcon, 
        String strIPTransmitter,
        int intPortTransmitter,
        String strContentType,
        int intTTL)
    {
        super(winMainAppli, strTitleApplication, imgIcon);
        
        /**if (super._strTitleApplication_ == null)
        {
            String strTitle = com.google.code.p.keytooliui.javax.media.rtp.RtpAbs.s_toString(
                strIPTransmitter, intPortTransmitter, strContentType, intTTL);
      
            setTitle(strTitle);
        }**/
        
        if (strTitleApplication == null)
        {
            String strTitle = com.google.code.p.keytooliui.javax.media.rtp.RtpAbs.s_toString(
                strIPTransmitter, intPortTransmitter, strContentType, intTTL);
      
            setTitle(strTitle);
        }
    }
    
    // -------
    // PRIVATE
}